home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / TupleDatabase / ADASTupleDatabase.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.3 KB  |  79 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ADASTupleDatabase.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __ADASTUPLEDATABASE__
  15. #define __ADASTUPLEDATABASE__
  16.  
  17. #ifndef __BLJSTANDARDINCLUDES__
  18. #include "BLJStandardIncludes.h"
  19. #endif
  20.  
  21. #ifndef __OCEAUTHDIR__
  22. #include "OCEAuthDir.h"
  23. #endif
  24.  
  25. class TADASTupleDatabase  {
  26.     // Creation/Deletion methods
  27.     public:
  28.         TADASTupleDatabase();
  29.     public:
  30.         virtual ~TADASTupleDatabase();
  31.     
  32.     // Access methods
  33.     public:
  34.         virtual Boolean GetTupleSize(void* key, long keySize, long &dataSize);
  35.  
  36.         virtual Boolean GetTuple(void* key, long keySize);    // test for existence
  37.         virtual Boolean GetTuple(void* key, long keySize, long& actualDataSize, void *data = NULL, long dataSize = 0);
  38.             /*finds the data associated with the key*/
  39.             /*and copies it into the space that ‘data’ points to*/
  40.  
  41.         virtual Boolean SetTuple(void *key, long keySize, void *data, long dataSize);
  42.             /*adds or updates a tuple with the given key and data*/
  43.             
  44.         virtual Boolean DeleteTuple(void *key, long keySize);
  45.             /*removes the tuple that matches the tuple’s key*/
  46.             
  47.         virtual long CountTuples();
  48.             /*returns the number of tuples in the database*/
  49.         
  50.         virtual Boolean GetIndexTuple(long i, void *key, long &keySize);
  51.         virtual Boolean GetIndexTuple(long i, void *key, long &keySize, void *data, long &dataSize);
  52.             /*gets the indexed tuple’s key and data from the database*/
  53.  
  54.         virtual Boolean FindIndexOfTuple(void *key, long keySize, long &i);
  55.         
  56.         virtual Boolean SetIndexTuple(long i, void *data, long dataSize);
  57.  
  58.         virtual void Flush(void);
  59.  
  60.         virtual Boolean IADASTupleDatabase (AuthIdentity identityToUse, short dsRefNum, RecordIDPtr ourRecord, AddrBlock* serverHint = nil);
  61.         
  62.         virtual Boolean CreateDatabase();
  63.         virtual Boolean DeleteDatabase ();
  64.         
  65.     protected:
  66.         virtual Boolean GetAttributeFromADASAttributeTypeAndIndex(AttributeType& attrType, long index, CreationID& cid, AttributeTag& tag, void* data, long& dataSize);
  67.         virtual Boolean GetIndexAttribute (long i, AttributeType& attrType);
  68.  
  69.     protected:
  70.         AuthIdentity        fAuthIdentity;
  71.         RecordIDPtr            fRecordIDPtr;
  72.         AddrBlock            fServerHint;
  73.         short                fDirRefNum;
  74. };
  75.  
  76. /***********************************|****************************************/
  77.  
  78. #endif
  79.